<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
	<form id="e_form" enctype="multipart/form-data">
		<ul>
			<li><span>评价</span> <select name="grade">
					<option value="1">好评</option>
					<option value="2">中评</option>
					<option value="3">差评</option>
			</select></li>
			<li><span>评价内容</span> <textarea name="content" id="" cols="30"
					rows="2"></textarea></li>
			<li><span>图片</span> <input type="file" multiple name="images">
			</li>
			<li><span></span>
				<button id="sub" type="button">提交</button></li>
		</ul>
	</form>
	<script src="https://cdn.bootcss.com/jquery/1.8.3/jquery.min.js"></script>
	<script type="text/javascript">
		window.onload = function() {
			var url = "${pageContext.request.contextPath}/shopEvaluation/submitComment";
			var form = $('#e_form')[0];
			$('#sub').on('click', function() {
				var formData = new FormData(form);
				var openId = '12345';
				var orderId = '12345';
				formData.append('open_id', openId);
				formData.append('order_id', orderId);
				$.ajax({
					url : url,
					type : 'POST',
					data : formData,
					processData : false,
					contentType : false,
					success : function(response, status, xhr) {
						console.log(response);
					},
					beforeSend : function() {
						console.log(formData);
					}
				})
			})
		}
	</script>
</body>
</html>